﻿#include <QApplication>
#include <QSettings>
#include <QDebug>
#include <QDesktopWidget>
#include <QTextCodec>
#include <QTranslator>
#include <QDir>

#include "global.h"
#include "TopLogin.h"
#include "MyApp.h"
#include "MainWindow.h"
#include "MessageBox.h"
#include "messageitem.h"
#include "LoginAnimationWin.h"
#include "CustomWidget.h"
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    app.setQuitOnLastWindowClosed(false);       //关闭最后一个无父窗口的窗口时程序不会退出

    QTranslator translator;
    translator.load(":/myI18N_zh_CN.qm");
    app.installTranslator(&translator);

    qDebug() << QDir::currentPath();
    myHelper::setStyle("default");
    MyApp::InitApp(app.applicationDirPath());
    //DataBaseMagr::Instance()->OpenUserDb(MyApp::s_strDatabasePath + "user.db");
    //DataBaseMagr::Instance()->OpenMessageDb(MyApp::s_strDatabasePath + "msg.db");
/*
    MainWindow *pMain=MainWindow::InitInstance();
    //pMain->setAttribute(Qt::WA_DeleteOnClose, true);
    pMain->setGeometry((QApplication::desktop()->width() - pMain->width())/2,(QApplication::desktop()->height() - pMain->height())/2,380,680);//居中显示
    pMain->show();
    pMain->setAttribute(Qt::WA_QuitOnClose, true);
    pMain->setAttribute(Qt::WA_DeleteOnClose,true);
    //BottomWidget w;*/
    //ChatWin w;
    //TopLogin *w = new TopLogin;
    //w->show();
    // 加载数据库
    //TopWidget w;
    //QQCellChild child;
    //ChatWin *w = new ChatWin;
    //w->setQQCell(&child);
    //EmotionWindow w;
    //ChatWindow w;
    //w->show();
    //MessageBox w;
    LoginAnimationWin *w = new LoginAnimationWin;
    w->show();
    return app.exec();
}
